cmake_minimum_required(VERSION 3.5)

set(CMAKE_CXX_STANDARD 14)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")

#project(asio_test)

if(WIN32)
	set(BOOSTROOT "E:\\WorkCode\\CppThirdPart\\boost")
endif()

find_package(Boost 1.74.0)

if(Boost_FOUND)
	message(STATUS "Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
	include_directories(${Boost_INCLUDE_DIRS})
	message(STATUS "Boost_LIBRARY_DIRS: " ${Boost_LIBRARY_DIRS})
	link_directories(${Boost_LIBRARIES})
	message(STATUS "Boost_LIBRARIES: " ${Boost_LIBRARIES})
else()
	message(FATAL_ERROR "Boost not found")
endif()

#add_executable(asio_test main.cpp)
#target_link_libraries(asio_test Boost::filesystem)

add_executable(chat_server chat_message.hpp chat_server.cpp)
target_link_directories(chat_server PUBLIC ${Boost_LIBRARY_DIRS})

add_executable(chat_client chat_client.cpp chat_message.hpp)
target_link_directories(chat_client PUBLIC ${Boost_LIBRARY_DIRS})